# def cry():
#     print("mmm")
#
# def cal01():
#     res = 0
#     for i in range(1,1001):
#         res+= i
#     return res
#
# def cal02(n):
#     res = 0
#     for i in range(1,n+1):
#         res += i
#     return res
#
# def get_sum(n,m):
#     return n + m
#
# def cry():
#     print("ccc")
#
#
# cry()

# def f2(n1,n2):
#     return n1 + n2,n1 - n2
# r1,r2 = f2(1,3)
# print(r1,r2,type(f2(1,2))) # 4 -2 <class 'tuple'>

#
# def book_info(name="xxx",price=111,author="hhh",amount=123):
#     print(f"name:{name}, price:{price},author:{author},amount:{amount}")
#
# def f1(p1,p2,p3="111",p4="222"):
#     print()
#
# # def f2(p1="111",p2):
# #     print()
#
#
# book_info()
# # name:xxx, price:111,author:hhh,amount:123
#
# book_info("haha")
# # name:haha, price:111,author:hhh,amount:123


def sum (*args):
    print(f"args->{args},type->{type(args)}")
    total = 0
    for e in args:
        total += e
    return total

#
# print(sum(1, 2, 3))
# # args->(1, 2, 3),type-><class 'tuple'>
# # 6
#
# print(sum(1, 2, 3, 4))
# # args->(1, 2, 3, 4),type-><class 'tuple'>
# # 10


def func(**key_args):
    print(f"key_args: {key_args}, type: {type(key_args)}")
    for arg in key_args:
        print(f"参数名: {arg}, 值: {key_args[arg]}")


# func(name="hahah",age=12)
# # key_args: {'name': 'hahah', 'age': 12}, type: <class 'dict'>
# # 参数名: name, 值: hahah
# # 参数名: age, 值: 12
#
# func(name="xixix",age=24,sex=1)
# # # key_args: {'name': 'xixix', 'age': 24, 'sex': 1}, type: <class 'dict'>
# # # 参数名: name, 值: xixix
# # # 参数名: age, 值: 24
# # # 参数名: sex, 值: 1


